1. Field of the Invention
The present invention relates to a computer program product, system, and method for invoking demote threads on processors to demote tracks from a cache.
2. Description of the Related Art
A cache management system buffers tracks in a storage device recently accessed as a result of read and write operations in a faster access storage device, such as memory, than the storage device storing the requested tracks. Subsequent read requests to tracks in the faster access cache memory are returned at a faster rate than returning the requested tracks from the slower access storage, thus reducing read latency. The cache management system may also return complete to a write request when the modified track directed to the storage device is written to the cache memory and before the modified track is written out to the storage device, such as a hard disk drive. The write latency to the storage device is typically significantly longer than the latency to write to a cache memory. Thus, using cache also reduces write latency.
A cache management system may maintain a linked list having one entry for each track stored in the cache, which may comprise write data buffered in cache before writing to the storage device or read data. In the commonly used Least Recently Used (LRU) cache technique, if a track in the cache is accessed, i.e., a cache “hit”, then the entry in the LRU list for the accessed track is moved to a Most Recently Used (MRU) end of the list. If the requested track is not in the cache, i.e., a cache miss, then the track in the cache whose entry is at the LRU end of the list may be removed and demoted and an entry for the track data staged into cache from the storage is added to the MRU end of the LRU list. With this LRU cache technique, tracks that are more frequently accessed are likely to remain in cache, while data less frequently accessed will more likely be removed from the LRU end of the list to make room in cache for newly accessed tracks.
To avoid the cache from becoming full and no free cache segments available for further I/O requests, tracks need to be demoted, i.e., removed from cache or invalidated in cache, to make room for new cache segment allocations for further accessed tracks. The active LRU cache list is scanned to determine unmodified tracks to move to a demote ready LRU list from where they will be demoted, i.e., removed. If the demote scan operation encounters modified tracks, the demote scan initiates a destaging operation of the modified track, and skips the modified track to process further tracks on the active LRU cache list. A destage operation writes the modified track to the storage while leaving the track in the cache.
There is a need in the art for improved techniques for selecting tracks for demotion from the cache.